import HttpUtil from '@/common/HttpUtil'

const commandApi = {

  /**
   * 获取人员,状态列表
   */
  findPersonnel (params) {
    let postUrl = process.env.SURVEY_DOMAIN + '/mobile/survey/device/getUserList'
    return HttpUtil.get(postUrl, params)
  },

  /**
   * 按日期查询动物调查事件列表
   */
  findEventByUser (params) {
    let postUrl = process.env.SURVEY_DOMAIN + '/mobile/survey/task/findEventByDayVal'
    return HttpUtil.post(postUrl, params)
  },

  /**
   * 按日期查询油茶个体调查事件列表
   */
  findOilteaSurveyByDayVal (params) {
    let postUrl = process.env.SURVEY_DOMAIN + '/mobile/survey/task/findOilteaSurveyByDayVal'
    return HttpUtil.post(postUrl, params)
  },

  /**
   * 获取里程时长统计数据
   * @param params
   * @returns {*|{headers, withCredentials}}
   */
  findPatrolStatistics (params) {
    let postUrl = process.env.SURVEY_DOMAIN + '/ws/stats/getTaskStatsByUser'
    return HttpUtil.postJSON(postUrl, params)
  },

  /**
   * 查询个人某个时间段工作情况及GPS
   * @param params
   * @returns {*|{headers, withCredentials}}
   */
  findTasksAndGps (params) {
    let postUrl = process.env.SURVEY_DOMAIN + '/mobile/survey/task/findTasksAndGps'
    return HttpUtil.post(postUrl, params)
  },
  // 获取所有未处理的数据
  getFindAllPage (params) {
    let postUrl = process.env.SURVEY_DOMAIN + '/ws/sampleAnimal/findAllPage'
    return HttpUtil.postJSON(postUrl, params)
  },
  /**
   * 查询项目样线树结构
   * @param params
   * @returns {*|{headers, withCredentials}}
   */
  findProjectChildren (params) {
    let postUrl = process.env.SURVEY_DOMAIN + '/ws/project/findProjectChildren'
    return HttpUtil.post(postUrl, params)
  },
  // 获取专家名称
  findSpecialist (params) {
    let postUrl = process.env.SURVEY_DOMAIN + '/sys/user/findSpecialist'
    return HttpUtil.postJSON(postUrl, params)
  },
  // 指定识别专家
  sendDiscern (params) {
    let postUrl = process.env.SURVEY_DOMAIN + '/ws/sampleAnimal/sendDiscern'
    return HttpUtil.postJSON(postUrl, params)
  },
  /**
   *  种质资源
   *  油茶调查
   * */
  // 分页获取油茶个体调查数据
  getFindPage (params) {
    let postUrl = process.env.SURVEY_DOMAIN + '/gr/oilteaSurvey/findPage'
    return HttpUtil.postJSON(postUrl, params)
  },
  // 分页获取样地
  getSampleFindPage (params) {
    let postUrl = process.env.SURVEY_DOMAIN + '/gr/oilteaSample/findPage'
    return HttpUtil.postJSON(postUrl, params)
  },
  // 多选样地ids得到个体调查列表
  batchBySamplePlotIds (params) {
    let postUrl = process.env.SURVEY_DOMAIN + '/gr/oilteaSurvey/batchBySamplePlotIds'
    return HttpUtil.postJSON(postUrl, params)
  },
  // 批量处理数据
  batchProcessing (params) {
    let postUrl = process.env.SURVEY_DOMAIN + '/gr/oilteaSurvey/batchProcessing'
    return HttpUtil.postJSON(postUrl, params)
  }
}
export default commandApi
